Image processing method and device, and electronic device

ABSTRACT

Provided are an image processing method and device and an electronic device. The method may include: a first image and a second image are obtained; a facial key point of a target object in the first image is detected to obtain information of a first key point; a facial key point of a target object in the second image is detected to obtain information of a second key point; a conversion relationship is determined based on the information of the first key point and the information of the second key point; and faces of the target objects in the first image and the second image are fused based on the conversion relationship to obtain a third image.

CROSS-REFERENCE TO RELATED APPLICATION

The present application is a continuation of International PatentApplication No. PCT/CN2020/087498, filed on Apr. 28, 2010, which claimspriority to Chinese Patent Application No. 201910944389.8, filed on Sep.30, 2019. The disclosures of International Patent Application No.PCT/CN2020/087498 and Chinese Patent Application No. 201910944389.8 arehereby incorporated by reference in their entireties.

TECHNICAL FIELD

The disclosure relates to an image processing technology, andparticularly to an image processing method and device and an electronicdevice.

BACKGROUND

In related art, there is yet no effective solution for how to fusedifferent faces in two different face images to obtain one face.

SUMMARY

A first aspect of the disclosure provides a method for image processing,which may include the following operations.

A first image and a second image are obtained. A facial key point of atarget object in the first image is detected to obtain information of afirst key point. A facial key point of a target object in the secondimage is detected to obtain information of a second key point. Aconversion relationship is determined based on the information of thefirst key point and the information of the second key point. Faces ofthe target objects in the first image and the second image are fusedbased on the conversion relationship to obtain a third image.

A second aspect of the disclosure provides an image processing device,which may include an acquisition unit, a key point detection unit and afusion processing unit.

The acquisition unit may be configured to obtain a first image and asecond image.

The key point detection unit may be configured to detect a facial keypoint of a target object in the first image to obtain information of afirst key point and detect a facial key point of a target object in thesecond image to obtain information of a second key point.

The fusion processing unit may be configured to determine a conversionrelationship based on the information of the first key point and theinformation of the second key point, and fuse faces of the targetobjects in the first image and the second image based on the conversionrelationship to obtain a third image.

A third aspect of the disclosure provides a computer-readable storagemedium in which a computer program may be stored, the program beingexecuted by a processor to implement the operations of the method of theembodiments of the disclosure.

A fourth aspect of the disclosure provides an electronic device, whichmay include a memory, a processor and a computer program stored in thememory and capable of running in the processor, the processor executingthe program to implement the operations of the method of the embodimentsof the disclosure.

A fifth aspect of the disclosure provides a processor, which may beconfigured to call a computer program, the processor executing theprogram to implement the operations of the method of the embodiments ofthe disclosure.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a first flowchart of an image processing method according toan embodiment of the disclosure.

FIG. 2A is a schematic diagram of facial key points in an imageprocessing method according to an embodiment of the disclosure.

FIG. 2B is a schematic diagram of a information of a first set ofcontour points and a information of a second set of contour points infacial key points according to an embodiment of the disclosure.

FIG. 2C is a schematic diagram of peripheral key point information infacial key points according to an embodiment of the disclosure.

FIG. 3 is a second flowchart of an image processing method according toan embodiment of the disclosure.

FIG. 4 is a third flowchart of an image processing method according toan embodiment of the disclosure.

FIG. 5 is a first composition structure diagram of an image processingdevice according to an embodiment of the disclosure.

FIG. 6 is a second composition structure diagram of an image processingdevice according to an embodiment of the disclosure.

FIG. 7 is a third composition structure diagram of an image processingdevice according to an embodiment of the disclosure.

FIG. 8 is a hardware composition structure diagram of an electronicdevice according to an embodiment of the disclosure.

DETAILED DESCRIPTION

The disclosure will further be described below in combination with thedrawings and specific embodiments in detail.

The embodiments of the disclosure provide an image processing method.FIG. 1 is a first flowchart of an image processing method according toan embodiment of the disclosure. As shown in FIG. 1, the method includesthe following operations.

In operation 101, a first image and a second image are obtained.

In operation 102, a facial key point of a target object in the firstimage is detected to obtain information of a first key point, and afacial key point of a target object in the second image is detected toobtain information of a second key point.

In operation 103, a conversion relationship is determined based on theinformation of the first key point and the information of the second keypoint.

In operation 104, faces of the target objects in the first image and thesecond image are fused based on the conversion relationship to obtain athird image.

In the embodiment, the first image and the second image may includefaces of target objects. The target objects may be real persons in theimages. In another implementation mode, the target objects may also bevirtual persons, for example, cartoon characters. The target objects mayalso be objects of other types. No limits are made thereto in theembodiment of the disclosure.

In some embodiments, the first image and the second image includedifferent target objects. For example, both the first image and thesecond image include faces, but the first image and the second imageinclude different faces. In this embodiment, fusion processing is mainlyperformed on different faces to synthesize one face.

In the embodiment, both the information of the first key point and theinformation of the second key point include key point information ofeach organ in a facial region and contour key point information of anedge of the facial region. The organ in the facial region may include atleast one of following: eye, nose, mouse, eyebrow and the like. The keypoint information of each organ in the facial region may include centralkey point information of each organ and/or contour key point informationof the organ. The contour key point information of the edge of thefacial region is key point information corresponding to a contour of thefacial region. The information of the first key point and theinformation of the second key point may include, but not limited to,coordinates of key points. The information of the first key point andthe information of the second key point may further include, forexample, type identifiers of the key points. Exemplarily, a typeidentifier may indicate whether a key point is a key point of an organor a contour key point of an edge.

In some embodiments of the disclosure, the operation 102 that the facialkey point of the target object in the first image is detected to obtainthe information of the first key point may include that: the first imageis detected based on a facial key point detection algorithm to obtainkey point information of each organ in a facial region of the firstimage and contour key point information of an edge of the facial region.

The operation that the contour key point information of the edge of thefacial region is obtained may include: a information of a first set ofcontour points of a region below eyes in the facial region is obtained;a information of a second set of contour points of a forehead region isdetermined based on key point information related to the forehead regionin the facial region; and the contour key point information of the edgeof the facial region is determined based on the information of the firstset of contour points and the information of the second set of contourpoints. Correspondingly, detecting the second image to obtain thecorresponding information of the second key point is similar to theabove step of obtaining the information of the first key point and willnot be elaborated herein.

FIG. 2A is a schematic diagram of facial key points in an imageprocessing method according to an embodiment of the disclosure. As shownin FIG. 2A, on a first aspect, a key point of an organ in a facialregion may specifically be a key point of at least one of the followingorgans in the facial region: eyebrow, eye, nose, mouse and the like. Insome implementation modes, key point information of an organ may includecentral key point information of the organ and/or contour key pointinformation of the organ. For example, when the organ is eye, key pointinformation of the eye includes central key point information of the eyeand contour key point information of the eye. For example, the key pointinformation of the eye includes a coordinate of a central key point ofthe eye and a coordinate of a contour key point of the eye. For anotherexample, when the organ is eyebrow, key point information of the eyebrowmay include contour key point information of the eyebrow. For example,the key point information of the eyebrow may include a coordinate of acontour key point of the eyebrow. In the embodiment, key pointinformation of each organ in the facial region is first obtained througha facial key point detection algorithm.

On a second aspect, the information of the first set of contour pointsof the region below the eye in the facial region may be obtained throughthe facial key point detection algorithm. A first set of contour pointsare shown in FIG. 2B. In some embodiments, a relatively small number M1of key points, for example, 5 key points, below the eye in the facialregion may be obtained through the facial key point detection algorithm.Then, M2 key points may be obtained for the M1 key points in a curveinterpolation manner. The M1 key points and the M2 key points are takenas the information of the first set of contour points.

The facial key point detection algorithm may be any face recognitionalgorithm.

On a third aspect, the contour key point information of the foreheadregion may be acquired. As an example, information of at least three keypoints in the forehead region of the facial region may be determinedbased on a preset parameter. For example, information of three keypoints is determined. As shown in FIG. 2B, key point 1 corresponds to akey point on a central line of the forehead region, and key point 2 andkey point 3 are on two sides of the key point 1 respectively. Curvefitting may be performed on key point 4 and key point 5 at two ends inthe information of the first set of contour points (the key point 4 andthe key point 5 are key points closest to the eyes in the information ofthe first set of contour key points), the key point 1, the key point 2and the key point 3 to obtain curve-fitted key point information.Interpolation information may be performed on the curve-fitted key pointinformation based on a curve interpolation algorithm to obtain theinformation of the second set of contour points matched with theforehead region.

In such a manner, the information of the first set of contour points andthe information of the second set of contour points can be determined,thereby determining the contour key point information of the edge of thefacial region. Then, the information of the first key point and theinformation of the second key point may be obtained based on the contourkey point information of the edge of the facial region and the key pointinformation of each organ in the facial region.

In some embodiments of the disclosure, the information of the first keypoint and the information of the second key point may further includeperipheral key point information associated with the facial region. Theperipheral key point information corresponds to the contour key pointinformation of the edge of the facial region. FIG. 2C is an exemplarydescription of a peripheral key point.

In some embodiments, the operation that the peripheral key pointinformation is determined may include: a central point of the facialregion is determined, the central point being, for example, a key pointcorresponding to the tip of nose; a distance between each contour keypoint of the edge of the facial region and the central point isdetermined, and a direction of each contour key point relative to thecentral point is determined; and for a first contour key point, aperipheral key point corresponding to the first contour key point isdetermined in a preset distance away from the first contour key pointand towards an outer side of the facial region in a direction along withthe first contour key point, the first contour key point being anycontour key point of the edge of the facial region. The preset distanceis related to a distance between the contour key point of the edge andthe central point. If the distance between the contour key point of theedge and the central point is longer, the preset distance is longer. Ifthe distance between the contour key point of the edge and the centralpoint is shorter, the preset distance is shorter. Based on such amanner, the peripheral key point information outside the facial regionshown in FIG. 2C may be determined.

In the embodiment, a purpose of determining the peripheral key pointinformation is that, in an image morphing processing process,particularly in a process of performing image morphing processing in atriangular morphing region-based morphing processing manner, adaptivemorphing processing may be performed on a triangular morphing regionformed by the peripheral key point information and the contour key pointinformation of the edge of the facial region, namely adaptive morphingprocessing may be performed on a transition region (i.e., a regionbetween the peripheral key point and the contour key point of the edgeof the facial region) associated with the facial region, therebyachieving a better image morphing effect and making a face fusion effectmore natural.

In some embodiments of the disclosure, the operation 103 may include: afirst conversion relationship is determined based on the information ofthe first key point and the information of the second key point;morphing processing is performed on the face of the target object in thefirst image based on the first conversion relationship to obtain a firstreference image; a facial key point of a target object in the firstreference image is detected to obtain information of a third key point;and a second conversion relationship is determined based on theinformation of the second key point and the information of the third keypoint.

In the embodiment of the disclosure, at least the first conversionrelationship based on which conversion processing is performed on thefirst image and the second conversion relationship based on whichconversion processing is performed on the second image are included.Moreover, conversion processing may be performed on the first imagebased on the first conversion relationship to obtain the first referenceimage. The facial key point of the target object in the first referenceimage may be extracted and recorded as the information of the third keypoint. The second conversion relationship may be determined based on theinformation of the second key point and the information of the third keypoint. In this way, the second image can be converted to the firstreference image to fuse the faces of the target objects in the firstimage and the second image to achieve an effect that the face of thetarget object in the obtained third image is similar to the faces inboth the first image and the second image.

It is to be noted that, in the embodiment, the operation that fusionprocessing is performed on faces of target objects in two images mayinclude that the faces of the target objects in the two images are fusedto make a face of the target object in an obtained new image similar tothe faces of the target objects in both the first image and the secondimage, and may further include that morphing processing is performed onthe face of the target object in one image of the two images and thenthe face of the target object subjected to morphing processing and theface of the target object in the image not subjected to morphingprocessing are fused.

With adoption of the technical solution of the embodiment of thedisclosure, different face images can be fused to obtain one face imageon one hand; and on the other hand, facial key points can be detected toimplement accurate positioning of the facial key points (for example, afacial organ and contour), and corresponding fusion processing ormorphing processing may be performed based on the facial key points in aface fusion process, so that the processing effect of face fusion isgreatly improved.

Based on the abovementioned embodiment, the embodiments of thedisclosure also provide an image processing method. FIG. 3 is a secondflowchart of an image processing method according to an embodiment ofthe disclosure. As shown in FIG. 3, the method includes the followingoperations.

In operation 201, a first image and a second image are obtained.

In operation 202, a facial key point of a target object in the firstimage is detected to obtain information of a first key point, and afacial key point of a target object in the second image is detected toobtain information of a second key point.

In operation 203, a first conversion relationship is determined based onthe information of the first key point and the information of the secondkey point.

In operation 204, morphing processing is performed on the face of thetarget object in the first image based on the first conversionrelationship to obtain a first reference image.

In operation 205, a facial key point of a target object in the firstreference image is detected to obtain information of a third key point.

In operation 206, a second conversion relationship is determined basedon the information of the second key point and the information of thethird key point.

In operation 207, morphing processing is performed on a face of thetarget object in the second image based on the second conversionrelationship to obtain a target image.

In operation 208, faces of the target objects in the target image andthe first reference image are fused to obtain a third image.

In the embodiment, detailed descriptions about operations 201 to 202 mayspecifically refer to the detailed descriptions about operations 101 to102 in the abovementioned embodiment, and elaborations are omittedherein.

In the embodiment, the first conversion relationship may be determinedbased on a coordinate, represented by the information of the first keypoint, of each key point and a coordinate, represented by theinformation of the second key point, of each key point in operation 203.Exemplarily, the first conversion relationship may be implementedthrough a conversion matrix. An manner for obtaining the conversionmatrix may include that: a set of coordinates of initial key points aredetermined, the set of coordinates of the initial key points beingrepresented by a matrix (for example, recorded as matrix H); a set ofcoordinates of target key points are determined, the set of coordinatesof the target key points being represented by another matrix (forexample, recorded as matrix P); and if the conversion matrix is recordedas Q, H·Q=P, namely Q=P·H⁻¹. It can be understood that it is expectedthat conversion may be performed on the information of the first keypoint based on the first conversion relationship (for example, a firstconversion matrix) to obtain the information of the second key point,but key point information obtained by performing conversion on theinformation of the first key point based on the first conversionrelationship (for example, the first conversion matrix) may not becompletely matched with the information of the second key point forvarious reasons such as errors. Therefore, in the embodiment, the firstimage is processed based on the first conversion relationship (forexample, the first conversion matrix) in operation 204. Specifically,morphing processing is performed on the face of the target object in thefirst image based on the first conversion relationship, and an obtainedimage is recorded as the first reference image. Exemplarily, the firstconversion relationship in each embodiment of the disclosure may beimplemented through the first conversion matrix determined based on theset of coordinates of first key points and the set of coordinates ofsecond key points.

In the embodiment, an acquisition manner for the information of thethird key point in operation 205 may refer to the detailed descriptionsabout an acquisition manner for the information of the first key pointand the information of the second key point in operation 102 in theabovementioned embodiment and will not be elaborated herein.Exemplarily, the number of key points corresponding to the informationof the third key point may also be 106.

In some embodiments of the disclosure, for operation 206, both theinformation of the second key point and the information of the third keypoint includes coordinate information of corresponding key point. Theoperation that the second conversion relationship is determined based onthe information of the second key point and the information of the thirdkey point may include: weighted stacking processing is performed on theinformation of the second key point and the information of the third keypoint to obtain information of a fourth key point, and the secondconversion relationship is determined based on the information of thesecond key point and the information of the fourth key point.

In some embodiments, key point information (for example, the informationof the second key point, the information of the third key point and theinformation of the fourth key point) may include a coordinate of a keypoint. Weighted stacking processing may be performed on the coordinateof the second key point and the coordinate of the third key point basedon a preset weight coefficient to obtain a coordinate of the fourth keypoint. Then, the second conversion relationship may be determined basedon the coordinate of the second key point and the coordinate of thefourth key point.

Exemplarily, the coordinate of the fourth key point may meet thefollowing expression:PT4=alpha×PT2+(1−alpha)×PT3  (1).

PT4 represents the coordinate of the fourth key point, PT2 representsthe coordinate of the second key point, PT3 represents the coordinate ofthe third key point, and alpha represents the weight coefficient.

Morphing processing may subsequently be performed on the information ofthe second key point in the second image towards the information of thefourth key point based on the second conversion relationship to ensurethat the key point information in the second image (i.e., the targetimage) subjected to morphing processing is matched with the informationof the fourth key point, namely the coordinate of the key point in thetarget image is close to the coordinate of the fourth key point.

In some embodiments, morphing processing may be performed on the secondimage through an Inverse Distance Weighted (IDW) algorithm to obtain thetarget image. Specifically, according to the IDW algorithm, there ismade such a hypothesis that each key point (i.e., the second key pointand the fourth key point) has local impact on the target key point inthe target image, and such impact may be reduced along with prolongingof a distance. A coordinate of an initial target key point in the targetimage obtained by performing morphing processing on the second image ishypothesized, and a distance between the initial target key point andthe second key point or the fourth key point is determined based on thecoordinate of the second key point and the coordinate of the fourth keypoint. A weight of the second key point for the initial target key pointand a weight of the fourth key point for the initial target key pointare determined based on the distances. Weighted averaging processing isperformed on the distance between the initial target key point and thesecond key point and the distance between the target key point and thefourth key point based on the determined weights. The target key pointis determined based on an obtained result. It can be understood that thesecond conversion relationship may specifically refer to a process ofdetermining the target key point by use of the IDW algorithm, namelyperforming morphing processing on the information of the second keypoint in the second image towards the information of the fourth keypoint.

In another implementation mode, part of the information of the secondkey point in the second image may also be selected as a morphing keypoint(s), and processing may be performed in an IDW manner based on themorphing key point(s). By use of part of key points, the load of dataprocessing may be reduced.

In an embodiment of the disclosure, before the operation that morphingprocessing is performed on the face of the target object in the secondimage based on the second conversion relationship, the method furthermay include: Gaussian blurring processing is performed on a nostrilregion of the target object in the second image. The operation thatmorphing processing is performed on the face of the target object in thesecond image based on the second conversion relationship may include:morphing processing is performed on the face of the target object in thesecond image subjected to the Gaussian blurring processing based on thesecond conversion relationship.

In some embodiments of the disclosure, for solving the problem that thenostril region may be obviously black and the nostril region is tooincongruous after face fusion, before morphing processing is performedon the second image, Gaussian blurring processing (or also calledGaussian smoothing processing) may be performed on the nostril region ofthe facial region to face the black nostril region to solve the problemand make the face in the third image obtained by face fusion processingmore natural. During a practical application, the nostril region of thetarget object in the second image may be recognized through a facerecognition algorithm (the determined nostril region may be rectangular,round or in any other shape), and Gaussian blurring (or Gaussiansmoothing) processing may be performed on the determined nostril region.

In some embodiments of the disclosure, the operation 208 that the facesof the target objects in the target image and the first reference imageare fused to obtain the third image may include: a facial key point of atarget object in the target image is detected to obtain information of afifth key point; a third conversion relationship is determined based onthe information of the third key point and the information of the fifthkey point; morphing processing is performed on the face of the targetobject in the first reference image based on the third conversionrelationship to obtain a second reference image; and the third image isobtained based on the second reference image and the target image.

In the embodiment, an acquisition manner for the information of thefifth key point may refer to the detailed descriptions about theacquisition manner for the information of the first key point and theinformation of the second key point in operation 102 in theabovementioned embodiment and will not be elaborated herein.

In some embodiments of the disclosure, it can be seen from FIG. 2A thata triangular morphing region may be determined by any three adjacent keypoints. In the embodiment, according to the same rule, a triangularmorphing region may be determined based on the information of the thirdkey point, and a triangular morphing region may be determined based onthe information of the fifth key point. The third conversionrelationship may be determined based on the coordinate of the third keypoint and a coordinate of a fifth key point, and morphing processing maybe performed on the triangular morphing regions based on the thirdconversion relationship to obtain the second reference image. It can beunderstood that a position of the third key point in the first referenceimage is expected to be morphed to a position of the fifth key point inthe target image based on the third conversion relationship, but theposition of the third key point that is morphed may usually notcompletely overlap the position of the fifth key point for reasons suchas errors. Therefore, the first reference image subjected to morphingprocessing is recorded as the second reference image. Furthermore, thethird image is obtained based on the second reference image and thetarget image.

In some examples, the third conversion relationship may be implementedthrough a conversion matrix corresponding to each triangular morphingregion. For example, for a triangular morphing region, coordinatescorresponding to three third key points in the first reference image maybe determined and form a matrix, recorded as a matrix A; coordinatescorresponding to three fifth key points in the target image may bedetermined and form another matrix, recorded as a matrix B; and if theconversion matrix is recorded as Q, then A·Q=B, namely Q=B·A⁻¹. In suchcase, for each triangular morphing region, conversion processing may beperformed based on a corresponding third conversion relationship toobtain the second reference image.

In some embodiments of the disclosure, the operation that the thirdimage is obtained based on the second reference image and the targetimage may include: the second reference image and the target image arefused to obtain a third reference image; and the third reference imageand the target image are fused to obtain the third image.

In the embodiment, fusion processing may be performed twice on theobtained second reference image and target image. In another embodiment,fusion processing may also be performed once or more than twice.

In some embodiments of the disclosure, the operation that the secondreference image and the target image are fused to obtain the thirdreference image may include: a first average value of values of pixelsin the second reference image is determined, and a second average valueof values of pixels in the target image is determined; and a differencevalue between a value of a first pixel in the second reference image andthe first average value is calculated, and the difference value and thesecond average value are added to obtain the third reference image, thefirst pixel being any pixel in the second reference image.

In some embodiments, the operation that the first average value of thevalues corresponding to the pixels in the second reference image isdetermined may include: the first average value of color componentnumerical values in the values of the pixels in the second referenceimage is determined. Correspondingly, the operation that the secondaverage value of the values corresponding to the pixels in the targetimage is determined may include: the second average value of colorcomponent numerical values in the values of the pixels in the targetimage is determined. In the embodiment, a difference value between thefirst average value and a color component numerical value of the valueof the first pixel in the second reference image is calculated, and thedifference value is added to the second average value of color componentnumerical values in the values of pixels corresponding to the firstpixel in the target image to obtain the third reference image.

Specifically, both the second reference image and the target image maybe color images, and in such case, the value of each pixel in the secondreference image and the target image has color components capable offorming the color image. For example, the color images are Red GreenBlue (RGB) images. In such case, each pixel has three numerical valuescorresponding to a red color component, a green color component and ablue color component respectively, and the numerical values of threecolor components are combined to form a value of the pixel. Averagevalues of the three color components in the second reference image areobtained respectively, the average value of each color component beingrecorded as the second average value. Average values of the three colorcomponents in the target image are obtained respectively, the average ofeach color component being recorded as the second average value. Forexample, for a color component (for example, the red color component,the green color component or the blue color component), thecorresponding first average value is subtracted from a numerical valueof the color component of each pixel in the second reference image, andthen the second average value of the corresponding color component inthe target image is added. A similar processing manner can be adoptedfor other color components and other pixels, and obtained results arenumerical values of each color component of each pixel in the thirdreference image.

In some embodiments of the disclosure, the operation that the thirdreference image and the target image are fused to obtain the third imagemay include: weighted summation processing is performed on a value of asecond pixel in the third reference image and a value of a pixelcorresponding to the second pixel in the target image to obtain thethird image, the second pixel being any pixel in the third referenceimage.

In some embodiments, both the third reference image and the target imagemay be color images, and in such case, the value of each pixel in thesecond reference image and the target image has color components capableof forming the color image. For example, the color images are RGBimages. In such case, each pixel has three numerical valuescorresponding to a red color component, a green color component and ablue color component respectively, and the numerical values of the threecolor components are combined to form a value of the pixel. In theembodiment, weighted stacking may be performed on the numerical valuesof a certain color component of corresponding pixels in the thirdreference image and the target image respectively, and a weightedstacking result is a numerical value of the color component of acorresponding pixel in the third image. For example, for a colorcomponent (for example, the red color component, the green colorcomponent or the blue color component), a numerical value of the colorcomponent of a certain pixel in the third reference image is multipliedby a weight coefficient (for example, 40%), a numerical value of thecolor component of a corresponding pixel in the target image ismultiplied by (1−weight coefficient) (for example, 60%), and two resultsare added to obtain a result as a numerical value of the color componentof a corresponding pixel in the third image. During the practicalapplication, an alpha blending algorithm may be adopted for fusion in asecond fusion processing manner. In this fusion processing manner, thethird reference image and the target image are fused proportionally. Inanother implementation mode, different weight coefficients may also beset for the third reference image and the target image respectively. Aproduct obtained by multiplying a numerical value of a certain colorcomponent of the third reference image by a first proportion coefficientand a product obtained by multiplying a numerical value of the colorcomponent in the target image by a second proportion coefficient aresuperposed to obtain a stacking result and the stacking result is takenas a numerical value of the color component in the third image. A sum ofthe first proportion coefficient and the second proportion coefficientmay be not 1.

In some embodiments of the disclosure, before the operation that thefaces of the target objects in the target image and the first referenceimage are fused to obtain the third image, the method may furtherinclude that: optimization processing is performed on the firstreference image, the optimization processing including at least one ofthe following processing on the face of the target object in the firstreference image: skin smoothing processing, whitening processing andskin glowing processing. Correspondingly, the operation that the thirdimage is generated based on the target image and the first referenceimage may include: the third image is generated based on the targetimage and the optimized first reference image to achieve the effect thatthe image obtained by face fusion processing is more attractive.

In an embodiment of the disclosure, the method may further include that:image style transfer processing is performed on the third image toobtain a fifth image.

In the embodiment, parameters corresponding to multiple image styles maybe pre-configured. The image style may be, for example, an oil paintingstyle, a Chinese painting style and the like, and of course, may also beanother image style. When the obtained third image is of a default styleand under the condition of determining that there is an image styletransfer requirement, for example, receiving an image style transferinstruction, a corresponding image style parameter may be determinedaccording to the image style transfer instruction, and style transferprocessing may be performed on the third image based on the image styleparameter to obtain the fifth image.

During the practical application, the image style transfer instructionmay be received based on human-computer interaction. For example,multiple image style buttons may be displayed on a human-computerinteraction interface, and when a user indicates a target image style, acorresponding image style transfer instruction may be received.

With adoption of the technical solution of the embodiment of thedisclosure, on a first aspect, different face images can be fused toobtain one face image. On a second aspect, facial key points can bedetected to accurately position the facial key points (for example, afacial organ and contour), and corresponding fusion processing ormorphing processing can be performed based on the facial key points inthe face fusion processing process, so that the processing effect offace fusion is greatly improved. On a third aspect, Gaussian blurringprocessing may be performed on a nostril region to face the nostrilregion, so that the problem that the nostril region is obviously blackafter face fusion processing is solved, the face fusion effect is alsogreatly improved to a certain extent, and the faces may be fused morenaturally. On a fourth aspect, in the embodiment, morphing processingmay be performed on the second image through the IDW algorithm toretouch five organs on the face, and morphing processing may beperformed on the first reference image based on the triangular morphingregion to convert the facial region. On a fifth aspect, in theembodiment, average-value-based fusion processing and aproportional-blending-based processing may be adopted for fusion of thesecond reference image and the target image. The processing process issimple, and the processing efficiency is improved.

The embodiments of the disclosure also provide an image processingmethod. FIG. 4 is a third flowchart of an image processing methodaccording to an embodiment of the disclosure. As shown in FIG. 4, themethod includes the following operations.

In operation 301, a first image and a second image are obtained.

In operation 302, a facial key point of a target object in the firstimage is detected to obtain information of a first key point, and afacial key point of a target object in the second image is detected toobtain information of a second key point.

In operation 303, a first conversion relationship is determined based onthe information of the first key point and the information of the secondkey point.

In operation 304, morphing processing is performed on the face of thetarget object in the first image based on the first conversionrelationship to obtain a first reference image.

In operation 305, a facial key point of a target object in the firstreference image is detected to obtain information of a third key point.

In operation 306, a second conversion relationship is determined basedon the information of the second key point and the information of thethird key point.

In operation 307, morphing processing is performed on the second imagebased on the second conversion relationship to obtain a target image.

In operation 308, faces of the target objects in the target image andthe first reference image are fused to obtain a third image.

In operation 309, under the condition that mouth states of the targetobjects in the first image and the second image are different and thetarget object in the third image is in a mouth-open state, a toothaddition operation is executed on the target object in the third imagebased on a tooth template image to generate a fourth image.

In the embodiment, detailed descriptions about operations 301 to 308 mayspecifically refer to the detailed descriptions about operations 201 to208 in the abovementioned embodiment, and elaborations are omittedherein.

In the embodiment, in operation 309, when the target objects in both thefirst image and the second image are in a mouth-closed state, the targetobject in the third image obtained by face fusion processing is also inthe mouth-closed state. When the target object in one of the first imageand the second image is in the mouth-closed state and the target objectin the other image is in the mouth-open state, the target object in thethird image obtained by face fusion processing may be in themouth-closed state or the mouth-open state. When the target object inthe third image is in the mouth-open state, it is necessary to performtooth filling processing to achieve a more natural face fusion effect.

In the embodiment, multiple tooth template images may be pre-configured,and one tooth template image may be selected from the multiple toothtemplate images and added to a mouth region of the target object,thereby adding teeth to the target object to generate the fourth image.During the practical application, different tooth template images may beassociated with a shape of an open mouth region of the target object.Under the condition that the target object in the third image is in themouth-open state, the shape of the open mouth region of the targetobject can be recognized through an image recognition algorithm, and acorresponding type identifier may be determined based on the shape. Themultiple tooth template images may be indexed by corresponding typeidentifiers. Indexes of the multiple tooth template images may bequeried based on the type identifier to obtain the tooth template imagecorresponding to the type identifier, and the tooth template image maybe added to the open mouth region of the target object, therebyimplementing tooth addition.

In some embodiments of the disclosure, the method further may include:image style transfer processing is performed on the fourth image toobtain a fifth image.

In the embodiment, parameters corresponding to multiple image styles maybe pre-configured. The image style may be, for example, an oil paintingstyle, a Chinese painting style and the like, and of course, may also beanother image style. When the obtained fourth image is of a defaultstyle and under the condition of determining that there is an imagestyle transfer requirement, for example, receiving an image styletransfer instruction, a corresponding image style parameter may bedetermined according to the image style transfer instruction, and styletransfer processing may be performed on the fourth image based on theimage style parameter to obtain the fifth image.

During the practical application, the image style transfer instructionmay be received based on human-computer interaction. For example,multiple image style buttons may be displayed on a human-computerinteraction interface, and when a user indicates a target image style, acorresponding image style transfer instruction can be received.

The embodiment has the beneficial effects corresponding to theabovementioned embodiments. In addition, under the condition that thethird image is in the mouth-open state, tooth filling may be implementedto obtain a more real and natural mouth effect of the image obtained byface fusion processing.

The embodiments of the disclosure also provide an image processingdevice. FIG. 5 is a first composition structure diagram of an imageprocessing device according to an embodiment of the disclosure. As shownin FIG. 5, the device includes an acquisition unit 41, a key pointdetection unit 42 and a fusion processing unit 43.

The acquisition unit 41 is configured to obtain a first image and asecond image.

The key point detection unit 42 is configured to detect a facial keypoint of a target object in the first image to obtain information of afirst key point and detect a facial key point of a target object in thesecond image to obtain information of a second key point.

The fusion processing unit 43 is configured to determine a conversionrelationship based on the information of the first key point and theinformation of the second key point and fuse faces of the target objectsin the first image and the second image based on the conversionrelationship to obtain a third image.

In some embodiments of the disclosure, the fusion processing unit 43 isconfigured to determine a first conversion relationship based on theinformation of the first key point and the information of the second keypoint and perform morphing processing on the face of the target objectin the first image based on the first conversion relationship to obtaina first reference image.

The key point detection unit 42 is further configured to detect a facialkey point of a target object in the first reference image to obtaininformation of a third key point.

The fusion processing unit 43 is further configured to determine asecond conversion relationship based on the information of the secondkey point and the information of the third key point.

In some embodiments of the disclosure, the fusion processing unit 43 isconfigured to perform morphing processing on the face of the targetobject in the second image based on the second conversion relationshipto obtain a target image and fuse faces of target objects in the targetimage and the first reference image to obtain the third image.

In some embodiments of the disclosure, the information of the second keypoint includes coordinate information of the second key point and theinformation of the third key point includes coordinate information ofthe third key point. The fusion processing unit 43 is configured toperform weighted stacking processing on the information of the secondkey point and the information of the third key point to obtaininformation of a fourth key point and determine the second conversionrelationship based on the information of the second key point and theinformation of the fourth key point.

In some embodiments of the disclosure, the fusion processing unit 43 isconfigured to detect a facial key point of a target object in the targetimage to obtain information of a fifth key point, determine a thirdconversion relationship based on the information of the third key pointand the information of the fifth key point, perform morphing processingon the face of the target object in the first reference image based onthe third conversion relationship to obtain a second reference image andobtain the third image based on the second reference image and thetarget image.

In some embodiments of the disclosure, the fusion processing unit 43 isconfigured to fuse the second reference image and the target image toobtain a third reference image and fuse the third reference image andthe target image to obtain the third image.

In some embodiments of the disclosure, the fusion processing unit 43 isconfigured to determine a first average value of values of pixels in thesecond reference image, determine a second average value of values ofpixels in the target image, calculate a difference value between a valueof a first pixel in the second reference image and the first averagevalue and add the difference value to the second average value to obtainthe third reference image, the first pixel being any pixel in the secondreference image.

In some embodiments of the disclosure, the fusion processing unit 43 isconfigured to perform weighted summation processing on a value of asecond pixel in the third reference image and a value of a pixelcorresponding to the second pixel in the target image to obtain thethird image, the second pixel being any pixel in the third referenceimage.

In some embodiments of the disclosure, the fusion processing unit 43 isconfigured to, before the faces of the target objects in the targetimage and the first reference image are fused to obtain the third image,perform optimization processing on the first reference image. Theoptimization processing may include at least one of the followingprocessing on the face of the target object in the first referenceimage: skin smoothing processing, whitening processing and skin glowingprocessing. The fusion processing unit 43 is further configured togenerate the third image based on the target image and the optimizedfirst reference image.

In some embodiments of the disclosure, the fusion processing unit 43 isconfigured to, before performing morphing processing on the face of thetarget object in the second image based on the second conversionrelationship, perform Gaussian blurring processing on a nostril regionof the target object in the second image, and is further configured toperform morphing processing on the face of the target object in thesecond image subjected to the Gaussian blurring processing based on thesecond conversion relationship.

In some embodiments of the disclosure, the key point detection unit 42is configured to detect the first image based on a facial key pointdetection algorithm to obtain key point information of each organ in afacial region of the first image and contour key point information of anedge of the facial region.

In some embodiments of the disclosure, the key point detection unit 42is configured to obtain information of a first set of contour key pointsin a region below eyes in the facial region, determine information of asecond set of contour key points in a forehead region based on key pointinformation related to the forehead region in the facial region anddetermine the contour key point information of the edge of the facialregion based on the information of the first set of contour key pointsand the information of the second set of contour key points.

In some embodiments of the disclosure, the information of the first keypoint and the information of the second key point further includeperipheral key point information associated with the facial region; andthe peripheral key point information corresponds to the contour keypoint information of the edge of the facial region.

In some embodiments of the disclosure, the key point detection unit 42is further configured to determine a central point of the facial region,determine a distance between each contour key point of the edge of thefacial region and the central point, determine a direction of eachcontour key point relative to the central point, and for a first contourkey point, determine a peripheral key point corresponding to the firstcontour key point in a preset distance away from the first contour keypoint and towards an outer side of the facial region in a directionalong with the first contour key point, the first contour key pointbeing any contour key point of the edge of the facial region.

In some embodiments of the disclosure, as shown in FIG. 6, the devicemay further include an image processing unit 44, configured to, underthe condition that mouth states of the target objects in the first imageand the second image are different and a target object in the thirdimage is in a mouth-open state, execute a tooth addition operation onthe target object in the third image based on a tooth template image togenerate a fourth image.

In some embodiments of the disclosure, as shown in FIG. 7, the devicemay further include a style transfer processing unit 45, configured toperform image style transfer processing on the third image or the fourthimage obtained by executing the tooth addition operation on the thirdimage to obtain a fifth image.

In the embodiments of the disclosure, all the acquisition unit 41, keypoint detection unit 42, fusion processing unit 43, image processingunit 44 and style transfer processing unit 45 in the image processingdevice may be implemented by a Central Processing Unit (CPU), a DigitalSignal Processor (DSP), Microcontroller Unit (MCU) or Field-ProgrammableGate Array (FPGA) in a terminal during a practical application.

It is to be noted that the image processing device provided in theembodiments is described with division of each of the abovementionedprogram modules as an example during image processing. During thepractical application, such processing may be allocated to differentprogram modules for completion according to a requirement, that is, aninternal structure of the device may be divided into different programmodules to complete all or part of abovementioned processing. Inaddition, the image processing device provided in the embodimentsbelongs to the same concept of the image processing method embodiments.Details about a specific implementation process thereof refer to themethod embodiments and will not be elaborated herein.

The embodiments of the disclosure also provide an electronic device.FIG. 8 is a hardware composition structure diagram of an electronicdevice according to an embodiment of the disclosure. As shown in FIG. 8,the electronic device includes a memory 52, a processor 51 and acomputer program stored in the memory 52 and capable of running in theprocessor 51, the processor 51 executing the program to implement theoperations of the method of the embodiments of the disclosure.

It can be understood that each component in the electronic device may becoupled together through a bus system 53. It can be understood that thebus system 53 is configured to implement connection communicationbetween these components. The bus system 53 includes a data bus andfurther includes a power bus, a control bus and a state signal bus.However, for clear description, various buses in FIG. 8 are marked asthe bus system 53.

It can be understood that the memory 52 may be a volatile memory or anonvolatile memory, and may also include both the volatile andnonvolatile memories. Herein, the nonvolatile memory may be a Read OnlyMemory (ROM), a Programmable Read-Only Memory (PROM), an ErasableProgrammable Read-Only Memory (EPROM), an Electrically ErasableProgrammable Read-Only Memory (EEPROM), a Ferromagnetic Random AccessMemory (FRAM), a flash memory, a magnetic surface memory, a compact discor a Compact Disc Read-Only Memory (CD-ROM). The magnetic surface memorymay be a disk memory or a tape memory. The volatile memory may be aRandom Access Memory (RAM), and is used as an external high-speed cache.It is exemplarily but unlimitedly described that RAMs in various formsmay be adopted, such as a Static Random Access Memory (SRAM), aSynchronous Static Random Access Memory (SSRAM), a Dynamic Random AccessMemory (DRAM), a Synchronous Dynamic Random Access Memory (SDRAM), aDouble Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), anEnhanced Synchronous Dynamic Random Access Memory (ESDRAM), a SyncLinkDynamic Random Access Memory (SLDRAM) and a Direct Rambus Random AccessMemory (DRRAM). The memory 52 described in the embodiment of thedisclosure is intended to include, but not limited to, memories of theseand any other proper types.

The method disclosed in the embodiments of the disclosure may be appliedto the processor 51 or implemented by the processor 51. The processor 51may be an integrated circuit chip with a signal processing capability.In an implementation process, each operation of the method may beimplemented by an integrated logic circuit of hardware in the processor51 or an instruction in a software form. The processor 51 may be auniversal processor, a DSP or another Programmable Logic Device (PLD), adiscrete gate or transistor logic device, a discrete hardware componentand the like. The processor 51 may implement or execute each method,operation and logical block diagram disclosed in the embodiments of thedisclosure. The universal processor may be a microprocessor, anyconventional processor or the like. The operations of the methoddisclosed in combination with the embodiments of the disclosure may bedirectly embodied to be executed and implemented by a hardware decodingprocessor or executed and implemented by a combination of hardware andsoftware modules in the decoding processor. The software module may bein a storage medium, and the storage medium may be in the memory 52. Theprocessor 51 may read information in the memory 52 and perform theoperations of the method in combination with hardware.

In an exemplary embodiment, the electronic device may be implemented byone or more Application Specific Integrated Circuits (ASICs), DSPs,PLDs, Complex Programmable Logic Devices (CPLDs), FPGAs, universalprocessors, controllers, MCUs, microprocessors or other electroniccomponents, and is configured to execute the abovementioned method.

The embodiments of the disclosure also provide a computer-readablestorage medium, in which a computer program is stored, the program beingexecuted by a processor to implement the operations of the method of theembodiments of the disclosure.

The embodiments of the disclosure also provide a processor, which isconfigured to call a computer program, the processor executing theprogram to implement the operations of the method of the embodiments ofthe disclosure.

According to the image processing method and device and an electronicdevice provided in the embodiments of the disclosure, the method mayinclude: the first image and the second image are obtained; the facialkey point of the target object in the first image is detected to obtainthe information of the first key point; the facial key point of thetarget object in the second image is detected to obtain the informationof the second key point; the conversion relationship is determined basedon the information of the first key point and the information of thesecond key point; and the faces of the target objects in the first imageand the second image are fused based on the conversion relationship toobtain the third image. With adoption of the technical solutions of theembodiments of the disclosure, different face images can be fused toobtain one face image on one hand; and on the other hand, facial keypoints are detected to implement accurate positioning of the facial keypoints (for example, a facial organ and contour), and correspondingfusion processing or morphing processing may be performed based on thefacial key points in a face fusion process, so that the processingeffect of face fusion is greatly improved.

In some embodiments provided by the disclosure, it is to be understoodthat the device and method may be implemented in another manner. Thedevice embodiments described above are only schematic. For example,division of the units is only logic function division, and otherdivision manners may be adopted during practical implementation. Forexample, multiple units or components may be combined or integrated intoanother system, or some characteristics may be neglected or notexecuted. In addition, coupling or direct coupling or communicationconnection between displayed or discussed components may be indirectcoupling or communication connection, implemented through someinterfaces, of the device or the units, or may be electrical ormechanical or in other forms.

The units described as separate parts may be or may not be physicallyseparated, and parts displayed as units may be or may not be physicalunits, and namely may be in the same place or may be distributed tomultiple network units. Part or all of the units may be selectedaccording to a practical requirement to achieve the purposes of thesolutions of the embodiments.

In addition, each functional unit in each embodiment of the disclosuremay be integrated into a processing unit. Each unit may also serve as anindependent unit and two or more than two units may also be integratedinto a unit. The integrated unit may be implemented in a hardware formand may also be implemented in form of hardware and software functionalunit.

Those of ordinary skill in the art should know that all or part of theoperations of the method embodiment may be implemented by relatedhardware instructed through a program, the program may be stored in acomputer-readable storage medium, and the program is executed to performthe operations of the method embodiment. The storage medium includes:various media capable of storing program codes such as a mobile storagedevice, a ROM, a RAM, a magnetic disk or a compact disc.

Or, when being implemented in form of software functional module andsold or used as an independent product, the integrated unit of thedisclosure may also be stored in a computer-readable storage medium.Based on such an understanding, the technical solutions of theembodiments of the disclosure substantially or parts makingcontributions to the conventional art may be embodied in form ofsoftware product, and the computer software product is stored in astorage medium, including a plurality of instructions configured toenable a computer device (which may be a personal computer, a server, anetwork device or the like) to execute all or part of the method in eachembodiment of the disclosure. The storage medium includes: various mediacapable of storing program codes such as a mobile hard disk, a ROM, aRAM, a magnetic disk or a compact disc.

The above is only the specific implementation mode of the disclosure andnot intended to limit the scope of protection of the disclosure. Anyvariations or replacements apparent to those skilled in the art withinthe technical scope disclosed by the disclosure shall fall within thescope of protection of the disclosure. Therefore, the scope ofprotection of the disclosure shall be subject to the scope of protectionof the claims.

The invention claimed is:
 1. A method for image processing, comprising:obtaining a first image and a second image; detecting a facial key pointof a target object in the first image to obtain information of a firstkey point, and detecting a facial key point of a target object in thesecond image to obtain information of a second key point; determining aconversion relationship based on the information of the first key pointand the information of the second key point; and fusing faces of thetarget objects in the first image and the second image based on theconversion relationship to obtain a third image, wherein determining theconversion relationship based on the information of the first key pointand the information of the second key point comprises: determining afirst conversion relationship based on the information of the first keypoint and the information of the second key point; performing morphingprocessing on the face of the target object in the first image based onthe first conversion relationship to obtain a first reference image;detecting a facial key point of a target object in the first referenceimage to obtain information of a third key point; and determining asecond conversion relationship based on the information of the secondkey point and the information of the third key point.
 2. The method ofclaim 1, wherein fusing the faces of the target objects in the firstimage and the second image based on the conversion relationship toobtain the third image comprises: performing morphing processing on theface of the target object in the second image based on the secondconversion relationship to obtain a target image; and fusing faces ofthe target objects in the target image and the first reference image toobtain the third image.
 3. The method of claim 1, wherein theinformation of the second key point comprises a coordinate of the secondkey point and the information of the third key point comprises acoordinate of the third key point; and determining the second conversionrelationship based on the information of the second key point and theinformation of the third key point comprises: performing weightedstacking processing on the coordinate of the second key point and thecoordinate of the third key point to obtain information of a fourth keypoint, the information of the fourth key point comprising a coordinateof the fourth key point; and determining the second conversionrelationship based on the coordinate of the second key point and thecoordinate of the fourth key point.
 4. The method of claim 2, whereinfusing the faces of the target objects in the target image and the firstreference image to obtain the third image comprises: detecting a facialkey point of the target object in the target image to obtain informationof a fifth key point; determining a third conversion relationship basedon the information of the third key point and the information of thefifth key point; performing morphing processing on the face of thetarget object in the first reference image based on the third conversionrelationship to obtain a second reference image; and obtaining the thirdimage based on the second reference image and the target image.
 5. Themethod of claim 4, wherein obtaining the third image based on the secondreference image and the target image comprises: fusing the secondreference image and the target image to obtain a third reference image;and fusing the third reference image and the target image to obtain thethird image.
 6. The method of claim 5, wherein fusing the secondreference image and the target image to obtain the third reference imagecomprises: determining a first average value of values of pixels in thesecond reference image, and determining a second average value of valuesof pixels in the target image; and calculating a difference valuebetween a value of a first pixel in the second reference image and thefirst average value, and adding the difference value and the secondaverage value to obtain the third reference image, the first pixel beingany pixel in the second reference image.
 7. The method of claim 5,wherein fusing the third reference image and the target image to obtainthe third image comprises: performing weighted summation processing on avalue of a second pixel in the third reference image and a value of apixel corresponding to the second pixel in the target image to obtainthe third image, the second pixel being any pixel in the third referenceimage.
 8. The method of claim 2, before fusing the faces of the targetobjects in the target image and the first reference image to obtain thethird image, the method further comprising: performing optimizationprocessing on the first reference image, wherein the optimizationprocessing comprises at least one of following processing on the face ofthe target object in the first reference image: skin smoothingprocessing, whitening processing and skin glowing processing, whereingenerating the third image based on the target image and the firstreference image comprises: generating the third image based on thetarget image and the optimized first reference image.
 9. The method ofclaim 2, before performing morphing processing on the face of the targetobject in the second image based on the second conversion relationship,the method further comprising: performing Gaussian blurring processingon a nostril region of the target object in the second image, whereinperforming morphing processing on the face of the target object in thesecond image based on the second conversion relationship comprises:performing, based on the second conversion relationship, morphingprocessing on the face of the target object in the second imagesubjected to the Gaussian blurring processing.
 10. The method of claim1, wherein detecting the facial key point of the target object in thefirst image to obtain the information of the first key point comprises:detecting the first image based on a facial key point detectionalgorithm to obtain key point information of each organ in a facialregion of the first image and contour key point information of an edgeof the facial region.
 11. The method of claim 10, wherein obtaining thecontour key point information of the edge of the facial regioncomprises: obtaining information of a first set of contour key points ina region below eyes in the facial region; determining information of asecond set of contour key points in a forehead region based on key pointinformation related to the forehead region in the facial region; anddetermining the contour key point information of the edge of the facialregion based on the information of the first set of contour key pointsand the information of the second set of contour key points.
 12. Themethod of claim 10, wherein the information of the first key point andthe information of the second key point further comprise peripheral keypoint information associated with the facial region; and the peripheralkey point information corresponds to the contour key point informationof the edge of the facial region.
 13. The method of claim 12, whereindetermining the peripheral key point information comprises: determininga central point of the facial region; determining a distance betweeneach contour key point of the edge of the facial region and the centralpoint, and determining a direction of each contour key point relative tothe central point; and for a first contour key point, determining aperipheral key point corresponding to the first contour key point, theperipheral key point being in a preset distance away from the firstcontour key point and towards an outer side of the facial region in adirection along with the first contour key point, and the first contourkey point being any contour key point of the edge of the facial region.14. The method of claim 1, further comprising: under a condition thatmouth states of the target objects in the first image and the secondimage are different and the target object in the third image is in amouth-open state, executing a tooth addition operation on the targetobject in the third image based on a tooth template image to generate afourth image.
 15. The method of claim 1, further comprising: obtaining afifth image by performing image style transfer processing on the thirdimage or a fourth image obtained by executing a tooth addition operationon the third image.
 16. A device for image processing, comprising: aprocessor; and a memory, configured to store instructions executable bythe processor, wherein the processor is configured to: detect a facialkey point of a target object in a first image to obtain information of afirst key point and detect a facial key point of a target object in asecond image to obtain information of a second key point; determine aconversion relationship based on the information of the first key pointand the information of the second key point; and fuse faces of thetarget objects in the first image and the second image based on theconversion relationship to obtain a third image, wherein the processoris further configured to: determine a first conversion relationshipbased on the information of the first key point and the information ofthe second key point and perform morphing processing on the face of thetarget object in the first image based on the first conversionrelationship to obtain a first reference image; detect a facial keypoint of a target object in the first reference image to obtaininformation of a third key point; and determine a second conversionrelationship based on the information of the second key point and theinformation of the third key point.
 17. The device of claim 7, whereinthe processor is further configured to perform morphing processing onthe face of the target object in the second image based on the secondconversion relationship to obtain a target image and fuse faces of thetarget objects in the target image and the first reference image toobtain the third image.
 18. A non-transitory computer-readable storagemedium, having stored a computer program thereon that, when executed bya processor, implements operations comprising: obtaining a first imageand a second image; detecting a facial key point of a target object inthe first image to obtain information of a first key point, anddetecting a facial key point of a target object in the second image toobtain information of a second key point; determining a conversionrelationship based on the information of the first key point and theinformation of the second key point; and fusing faces of the targetobjects in the first image and the second image based on the conversionrelationship to obtain a third image, wherein determining the conversionrelationship based on the information of the first key point and theinformation of the second key point comprises: determining a firstconversion relationship based on the information of the first key pointand the information of the second key point; performing morphingprocessing on the face of the target object in the first image based onthe first conversion relationship to obtain a first reference imagedetecting a facial key point of a target object in the first referenceimage to obtain information of a third key point; and determining asecond conversion relationship based on the information of the secondkey point and the information of the third key point.